﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Motorista.aspx.cs" Inherits="TrocaOleo.Viewer.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 108px;
        }
        .style3
        {
            width: 108px;
            height: 23px;
        }
        .style4
        {
            height: 23px;
        }
        .style5
        {
            width: 154px;
        }
        .style6
        {
            font-family: Arial, Helvetica, sans-serif;
            font-size: medium;
            font-weight: bold;
            text-align: center;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <p class="style6" style="position: relative">
        Cadastro Motorista</p>
    <p>
        <table class="style1">
            <tr>
                <td class="style2">
                    Nome:</td>
                <td class="style5">
                    <asp:TextBox ID="txtnome" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:Button ID="btnPesq" runat="server" Text="Pesquisar" />
                </td>
            </tr>
            <tr>
                <td class="style2">
                    CPF:</td>
                <td colspan="2">
                    <asp:TextBox ID="txtcpf" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style3">
                    DtAdmissão:</td>
                <td class="style4" colspan="2">
                    <asp:TextBox ID="txtdtadmissao" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Situação:</td>
                <td colspan="2">
                    <asp:DropDownList ID="DropDownList1" runat="server">
                        <asp:ListItem Value="A">Ativo</asp:ListItem>
                        <asp:ListItem Value="B">Bloqueado</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    CNH:</td>
                <td colspan="2">
                    <asp:TextBox ID="txtcnh" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    Categoria:</td>
                <td colspan="2">
                    <asp:TextBox ID="txtcategoria" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style2">
                    VencCNH:</td>
                <td>
                    <asp:TextBox ID="txtvenccnh" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:Button ID="btnGravar" runat="server" Text="Gravar" 
                        onclick="btnGravar_Click" />
                </td>
            </tr>
        </table>
        <br />
    </p>
    <p>
        
        <asp:GridView ID="GridView1" runat="server" DataSourceID="ODtS_Motorista" 
            EnableModelValidation="True" DataKeyNames="id" AutoGenerateColumns="True">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            </Columns>
        </asp:GridView>        
        <asp:ObjectDataSource ID="ODtS_Motorista" runat="server" 
            DeleteMethod="DeletarMotorista" 
            SelectMethod="ListarMotorista"             
            TypeName="TrocaOleo.Controller.WsTrocaOleo" 
             UpdateMethod="UpdateMotorista" 
            >
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <SelectParameters>
                <asp:ControlParameter ControlID="txtnome" DefaultValue="%" Name="name" 
                    PropertyName="Text" Type="String" />
            </SelectParameters>            
            <UpdateParameters>
                <asp:Parameter Name="id" Type="Int32" />
                <asp:Parameter Name="nome" Type="String" />
                <asp:Parameter Name="cpf" Type="String" />
                <asp:Parameter Name="data_admissao" Type="String" />
                <asp:Parameter Name="situacao" Type="String" />
                <asp:Parameter Name="cnh" Type="String" />
                <asp:Parameter Name="categoria_cnh" Type="String" />
                <asp:Parameter Name="vencimento_cnh" Type="String" />
            </UpdateParameters>
        </asp:ObjectDataSource>          
    </p>
</asp:Content>
